package com.test.graphsqltest.service.impl;

import com.test.graphsqltest.beans.Item;
import com.test.graphsqltest.beans.ItemList;
import com.test.graphsqltest.beans.Param;
import com.test.graphsqltest.dao.ItemDao;
import com.test.graphsqltest.service.IItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: TODO
 * @author: wangming
 * @date: 2021年08月14日 22:27
 */
@Service
public class ItemServiceImpl implements IItemService {
    @Autowired
    private ItemDao itemDao;
    /**
     * @Description: TODO
     * @author: wangming
     * @date: 查询专用
     * @Return:
     */
    @Override
    public ItemList queryItemList() {
       return itemDao.list();
    }

    /**
     * @param id
     * @Description: TODO
     * @author: wangming
     * @date: 根据id去查询
     * @Return:
     */
    @Override
    public Item queryById(Long id) {
       return itemDao.queryById(id);
    }

    /**
     * @param param
     * @Description: TODO
     * @author: wangming
     * @date: 更新姓名
     * @Return:
     */
    @Override
    public Item updateName(Param param) {
        return itemDao.updateNameById(param);
    }

    /**
     * @param id
     * @Description: TODO
     * @author: wangming
     * @date: 删除item
     * @Return:
     */
    @Override
    public Item deleteItem(Long id) {
        return itemDao.deleteItem(id);
    }
}
